package main

import (
	"fmt"
	"gin-ebook/docs"
	"gin-ebook/pkg/setting"
	routers "gin-ebook/Router"
	"net/http"
)

func main() {
	docs.SwaggerInfo.Title = "Blog API"
	docs.SwaggerInfo.Description = "This is a sample server Blog server."
	docs.SwaggerInfo.Version = "1.0.0"
	docs.SwaggerInfo.Host = "127.0.0.1:8000/api"
	docs.SwaggerInfo.BasePath = "/v1"
	//docs.SwaggerInfo.Schemes = []string{"http", "https"}

	router := routers.InitRouter()

	s := &http.Server{
		Addr:           fmt.Sprintf(":%d", setting.HTTPPort),
		Handler:        router,
		ReadTimeout:    setting.ReadTimeout,
		WriteTimeout:   setting.WriteTimeout,
		MaxHeaderBytes: 1 << 20,
	}

	s.ListenAndServe()
}
